<?php
	error_reporting(E_ALL^E_NOTICE);
    require_once ('../config/config.php'); 
	session_start();
	if(empty($_SESSION['member'])){
		echo "<script>location='./index.php';</script>";
	}
	if($_GET['ops']=="logout"){
	    //session_destroy();
	    unset($_SESSION['member']);
	    echo "<script>alert('成功退出！');location='./index.php';</script>";
	}
	$businessRs=mysqli_fetch_array(mysqli_query($con,"select * from business where user='".$_SESSION['member']."'"));
	if($_POST['submit']){
		if(empty($_POST['title']) or empty($_POST['address']) or empty(stripslashes($_POST['content'])) or empty($_POST['type']) or empty($_POST['salary']) or empty($_POST['classId'])){
			echo "<script>alert('请完善所有内容！');history.back();</script>";
		}else{
			mysqli_query($con,"update content set title='".$_POST['title']."',address='".$_POST['address']."',more='".stripslashes($_POST['content'])."',type='".$_POST['type']."',salary='".$_POST['salary']."',classId='".$_POST['classId']."',lastEditTime='".date("Y/m/d H:i:s")."',state='0' where id='".$_GET['id']."'");
			echo "<script>alert('您已成功修改兼职信息，请耐心等待管理员审核！');location='./index.php';</script>";
		}
	}
	if($_GET['ops']=="pay"){
		$bondRs=mysqli_fetch_array(mysqli_query($con,"select * from bond where user='".$_SESSION['member']."'"));
		if($bondRs['state']==""){
			$orderNo = "HYSSACS".date('Ymd').time().getKey(22);
			mysqli_query($con,"INSERT INTO `bond` VALUES ('','".$_SESSION['member']."','".$orderNo."','1000','".date("Y/m/d H:i:s")."','','0')");
			echo "<script>location='./pay/test.php';</script>";
		}else{
			echo "<script>location='./pay/test.php';</script>";
		}
	}	
	if($_GET['id']){
	    $contentRs=mysqli_fetch_array(mysqli_query($con,"select * from content where id='".$_GET['id']."'"));
	    if($contentRs['addUser']!=$_SESSION['member']){
	        exit("您无法管理该兼职");
	    }
	}
?>
<html lang="zh-CN" class="translated-ltr"><head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

	<!-- CSS -->
	<link rel="stylesheet" href="css/bootstrap-reboot.min.css">
	<link rel="stylesheet" href="css/bootstrap-grid.min.css">
	<link rel="stylesheet" href="css/owl.carousel.min.css">
	<link rel="stylesheet" href="css/nouislider.min.css">
	<link rel="stylesheet" href="css/select2.min.css">
	<link rel="stylesheet" href="css/jquery.mCustomScrollbar.min.css">
	<link rel="stylesheet" href="css/ionicons.min.css">
	<link rel="stylesheet" href="css/main.css">

	<!-- Favicons -->
	<link rel="icon" type="image/png" href="icon/favicon-32x32.png" sizes="32x32">
	<link rel="apple-touch-icon" href="icon/favicon-32x32.png">
	<link rel="apple-touch-icon" sizes="72x72" href="icon/apple-touch-icon-72x72.png">
	<link rel="apple-touch-icon" sizes="114x114" href="icon/apple-touch-icon-114x114.png">
	<link rel="apple-touch-icon" sizes="144x144" href="icon/apple-touch-icon-144x144.png">

	<meta name="description" content="">
	<meta name="keywords" content="">
	<meta name="author" content="Dmitry Volkov">
	<title>校园兼职网站 - 更新兼职发布</title>
	<link type="text/css" rel="stylesheet" charset="UTF-8" href="https://translate.googleapis.com/translate_static/css/translateelement.css">
	<link rel="stylesheet" href="./editor/themes/default/default.css" />
	<link rel="stylesheet" href="./editor/plugins/code/prettify.css" />
	<script charset="utf-8" src="./editor/kindeditor-all-min.js"></script>
	<script charset="utf-8" src="./editor/lang/zh-CN.js"></script>
	<script charset="utf-8" src="./editor/plugins/code/prettify.js"></script>
	<script>
		KindEditor.ready(function(K) {
			var editor1 = K.create('textarea[name="content"]', {
				cssPath : './editor/plugins/code/prettify.css',
				uploadJson : './editor/php/upload_json.php',
				fileManagerJson : './editor/php/file_manager_json.php',
				allowFileManager : true,
				afterCreate : function() {
					var self = this;
					K.ctrl(document, 13, function() {
						self.sync();
						K('form[name=example]')[0].submit();
					});
					K.ctrl(self.edit.doc, 13, function() {
						self.sync();
						K('form[name=example]')[0].submit();
					});
				}
			});
			prettyPrint();
		});
	</script>
</head>

<body>
	<!-- header -->
	<header class="header">
		<div class="container">
			<div class="row">
				<div class="col-7 col-md-9 col-lg-8 col-xl-9">
					<div class="header__content">
						<!-- header menu btn -->
						<button class="header__btn" type="button">
							<span></span>
							<span></span>
							<span></span>
						</button>
						<!-- end header menu btn -->

						<!-- header logo -->
						<a href="index.php" class="header__logo">
							<b>校园兼职网站</b>
						</a>
						<!-- end header logo -->

						<!-- header nav -->
						<ul class="header__nav">
							<!-- dropdown -->
							<li class="header__nav-item">
								<a href="index.php" class="header__nav-link"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">首页</font></font></a>
							</li>
							<li class="header__nav-item">
								<a href="news.php" class="header__nav-link"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">新闻</font></font></a>
							</li
							<!-- end dropdown -->

							<!-- dropdown -->
							<li class="header__nav-item">
								<a class="dropdown-toggle header__nav-link" href="#" role="button" id="dropdownMenuProjects" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">分类</font></font></a>

								<ul class="dropdown-menu header__dropdown-menu" aria-labelledby="dropdownMenuProjects">
									<?php
										$result=mysqli_query($con,"select * from class order by id asc");
										while($rs=mysqli_fetch_array($result)){
									?>
											<li><a href="index.php?id=<?php echo $rs['id'];?>"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"><?php echo $rs['className'];?></font></font></a></li>
									<?php }?>
								</ul>
							</li>
							<!-- end dropdown -->

							<!-- dropdown -->
							<li class="header__nav-item">
								<a class="dropdown-toggle header__nav-link" href="#" role="button" id="dropdownMenuJobs" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">商家服务</font></font></a>

								<ul class="dropdown-menu header__dropdown-menu" aria-labelledby="dropdownMenuJobs">
									<li><a href="add-job.php"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">发布工作</font></font></a></li>
								</ul>
							</li>
							<!-- end dropdown -->
						</ul>
						<!-- end header nav -->

					</div>
				</div>

				<div class="col-5 col-md-3 col-lg-4 col-xl-3">
					<div class="header__content header__content--end">
						<div class="header__profile">
							<?php
								if(empty($_SESSION['member'])){?>
									<a href="./signin.php"  role="button" id="dropdownMenuProfile">
										<span>
											<font style="vertical-align: inherit;">
												<font style="vertical-align: inherit;">登录</font>
											</font>
										</span>
									</a>
							<?php
								}else{?>
									<a class="dropdown-toggle header__profile-btn" href="#"  role="button" id="dropdownMenuProfile" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
										<span>
											<font style="vertical-align: inherit;">
												<font style="vertical-align: inherit;">欢迎您，<?php echo $_SESSION['member'];?></font>
											</font>
										</span>
									</a>
									<ul class="dropdown-menu dropdown-menu-right header__dropdown-menu header__dropdown-menu--right" aria-labelledby="dropdownMenuProfile">
									<li><a href="./company.php"><i class="icon ion-ios-exit"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">个人信息</font></font></a></li>
										<li><a href="./complaints-list.php"><i class="icon ion-ios-exit"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">投诉记录</font></font></a></li>
										<li><a href="../master/login.php"><i class="icon ion-ios-exit"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">后台管理</font></font></a></li>
										<li><a href="./resume.php"><i class="icon ion-ios-exit"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">我的简历</font></font></a></li>
										<li><a href="?ops=logout"><i class="icon ion-ios-exit"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">登出</font></font></a></li>
									</ul>
							<?php
								}
							?>
						</div>
					</div>
				</div>
			</div>
		</div>
	</header>
	<!-- end header -->

	<!-- main content -->
	<main class="main main--breadcrumb">
		<!-- breadcrumb -->
		<div class="breadcrumb">
			<div class="container">
				<div class="row">
					<div class="col-12">
						<ul class="breadcrumb__wrap">
							<li class="breadcrumb__item"><a href="./index.php"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">首页</font></font></a></li>
							<li class="breadcrumb__item breadcrumb__item--active"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">更新兼职发布</font></font></li>
						</ul>
					</div>
				</div>
			</div>
		</div>
		<!-- end breadcrumb -->

		<div class="container">
			<div class="row">
				<div class="col-12 col-md-7 col-lg-8 col-xl-9">
					<!-- form -->
					<form action="./edit-job.php?id=<?php echo $_GET['id'];?>" method="post" class="form">
						<div class="row">
							<div class="col-12">
								<h2 class="form__title"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">更新兼职发布</font></font></h2>
							</div>
							<?php 
								if($businessRs['prove']!="1"){
									exit("<div class='col-12'><div class='form__group'>您还未通过资质审核，请提交相关资质证明并等待审核通过！<br /><br /><a href='./prove.php'><button class='form__btn' type='button'><span><font style='vertical-align: inherit;'><font style='vertical-align: inherit;'>立即提交</font></font></span></button></a></div></div>");
								}else{
									$bondRs=mysqli_fetch_array(mysqli_query($con,"select * from bond where user='".$_SESSION['member']."'"));
									if($bondRs['state']!="1"){
										exit("<div class='col-12'><div class='form__group'>您已通过资质审核但未缴纳1000元保证金，缴纳完成后即可正常发布！<br /><br /><a href='?ops=pay'><button class='form__btn' type='button'><span><font style='vertical-align: inherit;'><font style='vertical-align: inherit;'>立即缴纳</font></font></span></button></a></div></div>");
									}else{
										if($businessRs['state']!="1"){
											exit("<div class='col-12'><div class='form__group'>您已通过资质审核并缴纳1000元保证金，但您的账号被暂停发布兼职信息！</div></div>");
										}else{
											echo "<div class='col-12'><div class='form__group'>您已通过资质审核并缴纳1000元保证金,可以正常发布兼职信息！</div></div>";
										}
									}
								}
							?>
							<div class="col-12">
								<div class="form__group">
									<label for="name" class="form__label"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">兼职标题：</font></font></label>
									<input name="title" id="name" type="text" class="form__input" placeholder="<?php echo $contentRs['title'];?>" value="<?php echo $contentRs['title'];?>">
								</div>
							</div>

							<div class="col-12">
								<div class="form__group">
									<label for="name" class="form__label"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">工作地址：</font></font></label>
									<input name="address" id="name" type="text" class="form__input" placeholder="<?php echo $contentRs['address'];?>" value="<?php echo $contentRs['address'];?>">
								</div>
							</div>

							<div class="col-12">
								<div class="form__group">
									<label for="description" class="form__label"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">描述：</font></font></label>
									<textarea id="editor_id" class="form__textarea" name="content" style="width:100%;height:500px;visibility:hidden;" ><?php echo stripslashes($contentRs['more']);?></textarea>
								</div>
							</div>
							
							<div class="col-12">
								<div class="form__group">
									<label for="name" class="form__label"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">兼职薪资：（单位：元/小时）</font></font></label>
									<input name="salary" id="name" type="number" class="form__input" placeholder="<?php echo $contentRs['salary'];?>" value="<?php echo $contentRs['salary'];?>">
								</div>
							</div>

							<div class="col-12 col-xl-6">
								<div class="form__group">
									<label for="category" class="form__label"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">兼职类别：</font></font></label>
									<div class="form__select-wrap">
										<select name="type" id="category" class="form__select">
											<option value="1" <?php if($contentRs['type']=="1"){echo "selected='selected'";}?>><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">长期</font></font></option>
											<option value="2" <?php if($contentRs['type']=="2"){echo "selected='selected'";}?>><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">短期</font></font></option>
										</select>
									</div>
								</div>
							</div>

							<div class="col-12 col-xl-6">
								<div class="form__group">
									<label for="type" class="form__label"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">所属分类：</font></font></label>
									<div class="form__select-wrap">
										<select name="classId" id="type" class="form__select">
											<?php
												$result=mysqli_query($con,"select * from class order by id asc");
												while($rs=mysqli_fetch_array($result)){
											?>
													<option value="<?php echo $rs['id'];?>" <?php if($contentRs['classId']==$rs['id']){echo "selected='selected'";}?>><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"><?php echo $rs['className'];?></font></font></option>
											<?php }?>
										</select>
									</div>
								</div>
							</div>

							<div class="col-12">
								<input class="form__btn" type="submit" name="submit" value="更新发布信息">
							</div>
						</div>
					</form>
					<!-- end form -->
				</div>

				<div class="col-12 col-md-5 col-lg-4 col-xl-3">
					<!-- sidebox -->
					<div class="sidebox sidebox--desk">
						<h4 class="sidebox__title"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">常问问题</font></font></h4>
						<div class="sidebox__content">
							<div class="sidebox__faq">
								<h5><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">发布兼职需要付费吗？</font></font></h5>
								<p><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">目前而言，发布兼职无需支付任何费用，但是需要进行资质认证和缴纳保证金。</font></font></p>
							</div>
							<div class="sidebox__faq">
								<h5><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">为什么发布的兼职信息需要审核？</font></font></h5>
								<p><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">为了保障兼职应聘的合法权益，我们需要对兼职信息进行人工审核。如果长时间未审核，请致电客服人员！</font></font></p>
							</div>
							<div class="sidebox__faq">
								<h5><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">为什么需要资质审核？</font></font></h5>
								<p><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">为了保障兼职应聘人员的合法权益，没有资质的用户无法认证为商家。因此没有进行资质审核的用户无法发布兼职信息。</font></font></p>
							</div>
						</div>
					</div>
					<!-- end sidebox -->
				</div>
			</div>
		</div>
	</main>
	<!-- end main content -->

	<!-- footer -->
	<footer class="footer">
		<div class="container">
			<div class="row">
				<div class="col-12">
					<div class="footer__content">
						<a href="index.php" class="footer__logo">
							校园兼职网站
						</a>

						<span class="footer__copyright"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">&copy;2022 <a href="http://www.huayu.edu.cn" target="_black">山东华宇工学院</a> SomeRights</font></font></span>
						<button class="footer__back" type="button">
							<i class="icon ion-ios-arrow-round-up"></i>
						</button>
					</div>
				</div>
			</div>
		</div>
	</footer>
	<!-- end footer -->

	<!-- JS -->
	<script src="js/jquery-3.4.1.min.js"></script>
	<script src="js/bootstrap.bundle.min.js"></script>
	<script src="js/owl.carousel.min.js"></script>
	<script src="js/wNumb.js"></script>
	<script src="js/nouislider.min.js"></script>
	<script src="js/select2.min.js"></script>
	<script src="js/jquery.mousewheel.min.js"></script>
	<script src="js/jquery.mCustomScrollbar.min.js"></script>
	<script src="js/main.js"></script><div id="goog-gt-tt" class="skiptranslate" dir="ltr"><div style="padding: 8px;"><div><div class="logo"><img src="https://www.gstatic.com/images/branding/product/1x/translate_24dp.png" width="20" height="20" alt="Google 翻译"></div></div></div><div class="top" style="padding: 8px; float: left; width: 100%;"><h1 class="title gray">原文</h1></div><div class="middle" style="padding: 8px;"><div class="original-text"></div></div><div class="bottom" style="padding: 8px;"><div class="activity-links"><span class="activity-link">提供更好的翻译建议</span><span class="activity-link"></span></div><div class="started-activity-container"><hr style="color: #CCC; background-color: #CCC; height: 1px; border: none;"><div class="activity-root"></div></div></div><div class="status-message" style="display: none;"></div></div>

<div class="goog-te-spinner-pos"><div class="goog-te-spinner-animation"><svg xmlns="http://www.w3.org/2000/svg" class="goog-te-spinner" width="96px" height="96px" viewBox="0 0 66 66"><circle class="goog-te-spinner-path" fill="none" stroke-width="6" stroke-linecap="round" cx="33" cy="33" r="30"></circle></svg></div></div></body></html>